export const useToken = () => {
    const token = useCookie('token', {
        expires: new Date(Date.now() + 1000 * 60 * 60 * 24 * 30),
        domain: '.boweixi.com',
        sameSite: undefined,
        path: '/',
        httpOnly: false
    })
    const setToken = (value: string) => {
        token.value = decodeURIComponent(value)
    }
    const getToken = () => {
        return token.value || ''
    }
    const removeToken = () => {
        token.value = null
    }
    return {
        setToken,
        getToken,
        removeToken
    }
}
